CXX = g++
CXXFLAGS = -Wall -std=c++0x -pedantic -O2 -DNDEBUG

CC = gcc
CFLAGS = -Wall -std=c99 -pedantic -O2 -DNDEBUG

SPECK_C99_BINARY = speck_c99.exe
SPECK_VEC_BINARY = speckvec.exe
SPECK_DEMO_BINARY = speckdemo.exe
SPECK_STAT_BINARY = speckstatistics.exe

all: $(SPECK_C99_BINARY) $(SPECK_VEC_BINARY) $(SPECK_DEMO_BINARY) $(SPECK_STAT_BINARY)

$(SPECK_C99_BINARY): speck_c99.o
	$(CC) -o $@ $^

$(SPECK_VEC_BINARY): speckvec.o
	$(CXX) -o $@ $^

$(SPECK_DEMO_BINARY): speckdemo.o
	$(CXX) -o $@ $^

$(SPECK_STAT_BINARY): speckstatistics.o bcstatistics.o
	$(CXX) -o $@ $^

clean:
	$(RM) *.o $(SPECK_C99_BINARY) $(SPECK_VEC_BINARY) $(SPECK_DEMO_BINARY) $(SPECK_STAT_BINARY)

.PHONY: all clean


speck_c99.o: speck_c99.c

speckdemo.o: speckdemo.cpp integer.hpp speck.hpp
speckvec.o: speckvec.cpp integer.hpp speck.hpp
bcstatistics.o: bcstatistics.cpp bcstatistics.hpp blockcipher.hpp
speckstatistics.o: speckstatistics.cpp bcstatistics.hpp blockcipher.hpp integer.hpp speck.hpp speckwrapper.hpp
